Skip to content

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Jun 22, 2025

Summary by CodeRabbit

  • New Features

    • Introduced an "Energy reset" button for energy devices, allowing users to reset energy data directly from the interface.
  • Improvements

    • Enhanced the energy-reset process to reduce ZigBee network traffic and server processor load.
  • Chores

    • Updated the Plugwise USB integration to use plugwise-usb version 0.44.4.
  • Documentation

    • Updated changelog and translations to reflect the new button and removal of the old service.

@bouwew bouwew requested a review from a team as a code owner June 22, 2025 06:34
@bouwew bouwew requested review from ArnoutD, brefra and dirixmjm June 22, 2025 06:34
@coderabbitai
Copy link

coderabbitai bot commented Jun 22, 2025

Warning

Rate limit exceeded

@bouwew has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a9c7bc4 and f38233f.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)

Walkthrough

This update removes the reset_energy_logs service from the Plugwise USB integration and introduces an "energy_reset" button entity for energy devices. The relevant service definitions, translations, and registration logic are deleted, while dependency versions are incremented to require plugwise-usb 0.44.4.

Changes

File(s) Change Summary
CHANGELOG.md Added changelog entry for v0.55.0, documenting plugwise-usb bump and energy-reset improvements.
custom_components/plugwise_usb/init.py Removed reset_energy_logs service implementation and registration.
custom_components/plugwise_usb/button.py Added "energy_reset" button entity description for NodeFeature.CIRCLE.
custom_components/plugwise_usb/manifest.json, requirements_test.txt Updated plugwise-usb dependency to 0.44.4; bumped integration version to 0.55.0.
custom_components/plugwise_usb/services.yaml Removed reset_energy_logs service definition.
custom_components/plugwise_usb/strings.json Removed reset_energy_logs service, added "energy_reset" button entity.
custom_components/plugwise_usb/translations/en.json, nl.json Removed reset_energy_logs translations; added "energy_reset" button translations.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeAssistant
    participant PlugwiseUSBIntegration
    participant PlugwiseDevice

    User->>HomeAssistant: Presses "energy_reset" button
    HomeAssistant->>PlugwiseUSBIntegration: Handles button press
    PlugwiseUSBIntegration->>PlugwiseDevice: Calls energy_reset_request
    PlugwiseDevice-->>PlugwiseUSBIntegration: Resets energy logs
    PlugwiseUSBIntegration-->>HomeAssistant: Confirms reset
    HomeAssistant-->>User: Button action complete
Loading

Possibly related PRs

Suggested reviewers

  • brefra
  • ArnoutD
  • dirixmjm

Poem

A button now, where service stood,
With one soft press, reset for good.
No more commands with cryptic names,
Just "energy_reset" in simple frames.
Dependencies rise, translations align,
Plugwise hops forward—everything's fine!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@bouwew bouwew force-pushed the ener-reset-button branch from 5f4aec6 to a21d18a Compare June 22, 2025 06:52
@bouwew bouwew force-pushed the ener-reset-button branch from 35b527f to 81a7e80 Compare June 22, 2025 09:23
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
CHANGELOG.md (2)

8-9: Clarify the bullet description.

  • Combine these lines into one clear sentence.
  • Replace “to address 0” with “to zero” (or “to 0”), e.g.:
    “Implement an energy-reset button for energy devices that resets the device’s energy collection data to zero, overwriting existing values.”

10-10: Improve phrasing for readability.
Consider rephrasing as:
“Improve the energy-reset process to reduce ZigBee traffic, network load, and server processor usage.”

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a21d18a and 81a7e80.

📒 Files selected for processing (9)
  • CHANGELOG.md (1 hunks)
  • custom_components/plugwise_usb/__init__.py (0 hunks)
  • custom_components/plugwise_usb/button.py (1 hunks)
  • custom_components/plugwise_usb/manifest.json (1 hunks)
  • custom_components/plugwise_usb/services.yaml (0 hunks)
  • custom_components/plugwise_usb/strings.json (1 hunks)
  • custom_components/plugwise_usb/translations/en.json (1 hunks)
  • custom_components/plugwise_usb/translations/nl.json (1 hunks)
  • requirements_test.txt (1 hunks)
💤 Files with no reviewable changes (2)
  • custom_components/plugwise_usb/services.yaml
  • custom_components/plugwise_usb/init.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • requirements_test.txt
  • custom_components/plugwise_usb/strings.json
  • custom_components/plugwise_usb/manifest.json
  • custom_components/plugwise_usb/button.py
  • custom_components/plugwise_usb/translations/nl.json
  • custom_components/plugwise_usb/translations/en.json
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[uncategorized] ~10-~10: Possible missing preposition found.
Context: ...ress 0, overwriting the existing data - Improve the energy-reset process, should result...

(AI_HYDRA_LEO_MISSING_TO)

🔇 Additional comments (2)
CHANGELOG.md (2)

5-5: Release entry format is correct.
The version v0.55.0 and date 2025-06-22 align with the existing changelog style.


7-7: Verify dependency bump consistency.
Please ensure that manifest.json and any test requirements have been updated to require plugwise-usb==0.44.4, and that the linked release URL is correct.

Copy link
Contributor

@dirixmjm dirixmjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description in strings.py and translations could be a little more clear.
"Reset energy log" maybe?

Otherwise ok for me.

Copy link
Member

@CoMPaTech CoMPaTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of hard and complex work, nice @bouwew

@sonarqubecloud
Copy link

@bouwew bouwew merged commit bb46133 into main Jun 22, 2025
8 checks passed
@bouwew bouwew deleted the ener-reset-button branch June 22, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants